package com.panshi.api;

import com.panshi.vo.R;
import com.panshi.vo.SysMenuVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "hasbei-sys.com", path = "/api/sys/menu")
public interface SysMenuApi {

    @GetMapping("/list")
    List<SysMenuVO> listSysMenu();

    @GetMapping("/pageMenuList/{current}/{limit}")
    R pageMenuList(@PathVariable Integer current, @PathVariable Integer limit);

    @GetMapping("/listTree")
    List<SysMenuVO> listSysMenuTree();

    @GetMapping("/{id}")
    SysMenuVO getSysMenu(@PathVariable("id")Integer id);

    @PostMapping
    R addSysMenu(@Validated @RequestBody SysMenuVO sysMenuVO);

    @PutMapping
    R editSysMenu(@Validated @RequestBody  SysMenuVO sysMenuVO);

    @DeleteMapping("/{id}")
    R delSysMenu(@PathVariable("id")Integer id);

    @GetMapping("/xmSelect")
    R xmSelect();

    @GetMapping("/getRoleXmSelect/{id}")
    R getRoleXmSelect(@PathVariable Integer id);



    //查询树形表格菜单列表
    @GetMapping(value = "/treeTableMenu")
    Map<String,Object> treeTableMenu();
}
